package com.repository;

import com.entity.FinanceAccount;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.Optional;

@Repository
public interface FinanceAccountRepository extends JpaRepository<FinanceAccount, Integer> {
    Optional<FinanceAccount> findByCompanyNameAndFlowDate(String companyName, Date flowDate);

    Page<FinanceAccount> findAllByOrderByFlowDateDesc(Pageable pageable);
}